package com.behealthy.android;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import com.behealthy.util.Utility;
import com.example.behealthy.R;
import com.facebook.android.Facebook;
import com.facebook.android.LoginButton;
import com.facebook.android.SessionStore;

public class BeHealthyProfileActivity extends Activity {

	// Facebook APP ID
			private static String App_ID = "474982679242477";

	// Instance of Facebook class
			private Facebook facebook;
			
	// Instance of shared preferences
			private final String PREFS = "MyPrefs";
			private SharedPreferences sharedPrefs;
			
			String genderStr, heightStr, weightStr, dietStr, workoutStr;
		
	public void onCreate(Bundle savedInstanceState) {
		 super.onCreate(savedInstanceState);
			 
		 setContentView(R.layout.activity_profile);
		 
		 setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
		 
		 sharedPrefs = getSharedPreferences(PREFS, 0);
		 getDetails();
		 
		 TextView gender = (TextView) findViewById(R.id.profile_gender);
		 gender.setText(genderStr);
		 TextView height = (TextView) findViewById(R.id.profile_height);
		 height.setText(heightStr);
		 TextView weight = (TextView) findViewById(R.id.profile_weight);
		 weight.setText(weightStr);
		 TextView diet = (TextView) findViewById(R.id.profile_diet);
		 diet.setText(dietStr);
		 TextView workout = (TextView) findViewById(R.id.profile_workout);
		 workout.setText(workoutStr);
			 
	}

	private void getDetails() {
	
		genderStr = sharedPrefs.getString("gender", null);
		heightStr = sharedPrefs.getString("height", null);
		weightStr = sharedPrefs.getString("weight", null);
		dietStr = sharedPrefs.getString("diet", null);
		workoutStr = sharedPrefs.getString("workout", null);
	
}

}
